﻿using System;
using agsXMPP;
using agsXMPP.protocol.client;
using sharpxbot.Core.Security;
using sharpxbot.Plugins.Base;
using sharpxbot.Plugins.Context;

namespace sharpxbot.Core.Plugins
{
    public class SystemInfoPlugin : AbstractPlugin
    {
        private static readonly Guid PluginGuid = new Guid("5c26b11f-8433-4cab-b6b9-77574c2d75a7");

        public override PluginPermissions NeededPermissions
        {
            get { return PluginPermissions.PluginOwner; }
        }

        public override string Name
        {
            get { return "SystemInfoPlugin"; }
        }

        public override string Author
        {
            get { return "tillias"; }
        }

        public override Guid GUID
        {
            get { return PluginGuid; }
        }

        public override string Description
        {
            get { return "System information plugin. Owner only"; }
        }

        public override string Usage
        {
            get { return "Not yet implemented"; }
        }

        public SystemInfoPlugin(IPluginContext context)
            : base(context) { }

        public override void ProcessMessage(Message message)
        {
            if (message != null)
            {
                if (message.Type == MessageType.chat && message.From.Bare == Context.OwnerJid)
                {
                    Message response = new Message()
                    {
                        To = new Jid(Context.OwnerJid),
                        Type = MessageType.chat,
                        Body = "Hello owner!"
                    };

                    //Context.Channel.Send(response);
                }
            }
        }


        public override void ProcessPresence(Presence presence)
        {
            //nothing todo here
        }
    }
}
